﻿using System;
using System.Xml.Serialization;
using System.Collections.Generic;

namespace MCMLXVII.BackEnd.Services.Common.Messages
{
    /// <summary>
    /// Summary description for VoidRequest.
    /// </summary>
    [Serializable()]
    [System.Xml.Serialization.XmlType(Namespace = "http://tempuri.org/")]
    public class msgGenericItemRequest<T>  
    {
        private T _Item;
        public msgGenericItemRequest()
        {
        }

        public msgGenericItemRequest(T Item)
        {
            _Item = Item;
        }

        public T Item
        {
            get
            {
                return _Item;
            }

            set
            {
                _Item = value;
            }
        }
    }


    [Serializable()]
    [System.Xml.Serialization.XmlType(Namespace = "http://tempuri.org/")]
    public class msgGenericItemList<T>  
    {
        private List<T> _List;
        public msgGenericItemList()
        {
           _List = new List<T>();
        }

        public msgGenericItemList(T[] Items)
        {
            _List = new List<T>();
            if (Items != null)
                _List.AddRange(Items);
        }

        public T[] GetArray()
        {
            return _List.ToArray();
        }

        public List<T> Items()
        {
            return _List;
        }

        public void Add(T item)
        {
            _List.Add(item);
        }

    }



    [Serializable()]
    [System.Xml.Serialization.XmlType(Namespace = "http://tempuri.org/")]
    public class msgGenericItemResponse<T>
    {
        private T _Item;
        public msgGenericItemResponse()
        {
        }

        public msgGenericItemResponse(T Item)
        {
            _Item = Item;
        }

        public T Item
        {
            get
            {
                return _Item;
            }

            set
            {
                _Item = value;
            }
        }
    }

}
